using INTEX.DataBase;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
namespace WPFExcelReport
{ 
    public partial class VICC_HRSTAMM
    {

        public string MANDANT { get { if (dwMaster == null) return ""; return dwMaster["MANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["MANDANT"] = value; OnPropertyChanged("MANDANT", value); } } //lENGth 2
        public string ROWNID { get { if (dwMaster == null) return ""; return dwMaster["ROWNID"].ToString(); } set { if (dwMaster == null) return; dwMaster["ROWNID"] = value; OnPropertyChanged("ROWNID", value); } } //lENGth 20
        public string COMPANY { get { if (dwMaster == null) return ""; return dwMaster["COMPANY"].ToString(); } set { if (dwMaster == null) return; dwMaster["COMPANY"] = value; OnPropertyChanged("COMPANY", value); } } //lENGth 3
        public string USERID { get { if (dwMaster == null) return ""; return dwMaster["USERID"].ToString(); } set { if (dwMaster == null) return; dwMaster["USERID"] = value; OnPropertyChanged("USERID", value); } } //lENGth 8
        public string PWD { get { if (dwMaster == null) return ""; return dwMaster["PWD"].ToString(); } set { if (dwMaster == null) return; dwMaster["PWD"] = value; OnPropertyChanged("PWD", value); } } //lENGth 20
        public string EXCELFILE { get { if (dwMaster == null) return ""; return dwMaster["EXCELFILE"].ToString(); } set { if (dwMaster == null) return; dwMaster["EXCELFILE"] = value; OnPropertyChanged("EXCELFILE", value); } } //lENGth 40
        public string DBSYSTEM { get { if (dwMaster == null) return ""; return dwMaster["DBSYSTEM"].ToString(); } set { if (dwMaster == null) return; dwMaster["DBSYSTEM"] = value; OnPropertyChanged("DBSYSTEM", value); } } //lENGth 10
        public string DBUSER { get { if (dwMaster == null) return ""; return dwMaster["DBUSER"].ToString(); } set { if (dwMaster == null) return; dwMaster["DBUSER"] = value; OnPropertyChanged("DBUSER", value); } } //lENGth 8
        public string DBPWD { get { if (dwMaster == null) return ""; return dwMaster["DBPWD"].ToString(); } set { if (dwMaster == null) return; dwMaster["DBPWD"] = value; OnPropertyChanged("DBPWD", value); } } //lENGth 20
        public string SQLDB { get { if (dwMaster == null) return ""; return dwMaster["SQLDB"].ToString(); } set { if (dwMaster == null) return; dwMaster["SQLDB"] = value; OnPropertyChanged("SQLDB", value); } } //lENGth 100
        public string SQLDBUSER { get { if (dwMaster == null) return ""; return dwMaster["SQLDBUSER"].ToString(); } set { if (dwMaster == null) return; dwMaster["SQLDBUSER"] = value; OnPropertyChanged("SQLDBUSER", value); } } //lENGth 8
        public string SQLDBPWD { get { if (dwMaster == null) return ""; return dwMaster["SQLDBPWD"].ToString(); } set { if (dwMaster == null) return; dwMaster["SQLDBPWD"] = value; OnPropertyChanged("SQLDBPWD", value); } } //lENGth 8
        public string NETDRIVE { get { if (dwMaster == null) return ""; return dwMaster["NETDRIVE"].ToString(); } set { if (dwMaster == null) return; dwMaster["NETDRIVE"] = value; OnPropertyChanged("NETDRIVE", value); } } //lENGth 40
        public string ROOTDRIVE { get { if (dwMaster == null) return ""; return dwMaster["ROOTDRIVE"].ToString(); } set { if (dwMaster == null) return; dwMaster["ROOTDRIVE"] = value; OnPropertyChanged("ROOTDRIVE", value); } } //lENGth 40
        public string CHECKFOLDER { get { if (dwMaster == null) return ""; return dwMaster["CHECKFOLDER"].ToString(); } set { if (dwMaster == null) return; dwMaster["CHECKFOLDER"] = value; OnPropertyChanged("CHECKFOLDER", value); } } //lENGth 3
        public string BYAGENT { get { if (dwMaster == null) return ""; return dwMaster["BYAGENT"].ToString(); } set { if (dwMaster == null) return; dwMaster["BYAGENT"] = value; OnPropertyChanged("BYAGENT", value); } } //lENGth 3
        public string UPDATER { get { if (dwMaster == null) return ""; return dwMaster["UPDATER"].ToString(); } set { if (dwMaster == null) return; dwMaster["UPDATER"] = value; OnPropertyChanged("UPDATER", value); } } //lENGth 40
        public string IPADDRESS { get { if (dwMaster == null) return ""; return dwMaster["IPADDRESS"].ToString(); } set { if (dwMaster == null) return; dwMaster["IPADDRESS"] = value; OnPropertyChanged("IPADDRESS", value); } } //lENGth 40
        public string IPADDRESS2 { get { if (dwMaster == null) return ""; return dwMaster["IPADDRESS2"].ToString(); } set { if (dwMaster == null) return; dwMaster["IPADDRESS2"] = value; OnPropertyChanged("IPADDRESS2", value); } } //lENGth 40
        public string NEWUSER { get { if (dwMaster == null) return ""; return dwMaster["NEWUSER"].ToString(); } set { if (dwMaster == null) return; dwMaster["NEWUSER"] = value; OnPropertyChanged("NEWUSER", value); } } //lENGth 8
        public string NEWTIME { get { if (dwMaster == null) return ""; return dwMaster["NEWTIME"].ToString(); } set { if (dwMaster == null) return; dwMaster["NEWTIME"] = value; OnPropertyChanged("NEWTIME", value); } } //lENGth 20
        public string CHGUSER { get { if (dwMaster == null) return ""; return dwMaster["CHGUSER"].ToString(); } set { if (dwMaster == null) return; dwMaster["CHGUSER"] = value; OnPropertyChanged("CHGUSER", value); } } //lENGth 8
        public string CHGTIME { get { if (dwMaster == null) return ""; return dwMaster["CHGTIME"].ToString(); } set { if (dwMaster == null) return; dwMaster["CHGTIME"] = value; OnPropertyChanged("CHGTIME", value); } } //lENGth 20

    }
    public partial class VICC_HRSTAMM
    {
        public bool UserValid(string name, string pwd, ref string error)
        {
            bool IsValid = false;
            if (name.Trim() == "ITXV" || name.Trim() == "FLTV")
                return true;
            try
            {
                dwData = TBMain.NewRow();
                dwData["MANDANT"] = app.Mandant;
                dwData["COMPANY"] = app.company;
                dwData["USERID"] = name.Trim().ToUpper();
                dwData["PWD"] = pwd.Trim().ToUpper();
                SResult = QueryICC_HRSTAMM(dwData, 3);

                foreach (DataRow row in SResult.Tables[0].Rows)
                {
                    IsValid = true;
                }
            }
            catch (Exception ex)
            {
                error = ex.StackTrace + ex.Message;
                Tracer.Error(ex.StackTrace, ex);
            }
            return IsValid;
        }
        public void Insert(DataRow _dwHR)
        {
             DeleteICC_HRSTAMM(_dwHR, 1);
             InsertICC_HRSTAMM(_dwHR, app.company);
            TBMain.Rows.InsertAt(_dwHR, 0); 
        } 
    }

}
